/*  mudmap - A tool to create and organize user side maps for MUD games
 *  Copyright (C) 2012  Neop (aka moemneop, email: mneop@web.de)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *  for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, see <http://www.gnu.org/licenses/>.
 */

/*  File description
 *
 *  Most GUI dialogs are in this file
 */

#pragma once

#include <sstream>
#include <memory>

#include <gtk/gtk.h>

#include "worldmgr.h"
#include "properties.h"
#include "dia_mapdrawing.h"

using std::stringstream;
using std::shared_ptr;

namespace dia{

typedef void(*funcptrstr)(string);
typedef void(*funcptrivptr)(int, void* mapd);

void world_new(GtkWidget *window_parent, funcptrstr open_world_func);
void world_edit(GtkWidget *parent, shared_ptr<world> w);
string world_file_chooser(GtkWidget *parent);

shared_ptr<place> place_dia(GtkWidget *parent, shared_ptr<place> pl = nullptr, shared_ptr<world> w = nullptr, int x = 0, int y = 0, int lay = -1);
shared_ptr<place> place_new(GtkWidget *parent, int x, int y, int lay, shared_ptr<world> w);
void place_edit(GtkWidget *parent, shared_ptr<place> pl, shared_ptr<world> w);
void place_edit_marked(GtkWidget *parent, shared_ptr<layer> lay, shared_ptr<world> w);
void place_add_way(GtkWidget *parent, int plid1, string dir1, int plid2, string dir2, shared_ptr<world> w);
void auto_ways(shared_ptr<layer> l, shared_ptr<place> pl, GtkWidget *parent);
void list_places(GtkWidget *parent, shared_ptr<world> w, void *mapd, funcptrivptr goto_place_func);
int choose_place(GtkWidget *parent, shared_ptr<world> w);

void search(GtkWidget *parent, shared_ptr<world> w, void *mapd, funcptrivptr goto_place_func);
void search_list_places(GtkWidget *parent, shared_ptr<world> w, void *mapd, funcptrivptr goto_place_func, string search_str);

void area_dia(GtkWidget *parent, shared_ptr<world> w, int arid = -1);
void new_area(GtkWidget *parent, shared_ptr<world> w);
void edit_area(GtkWidget *parent, shared_ptr<world> w, int arid);

void edit_comments(GtkWidget *parent, shared_ptr<place> pl);

string save_as_image(GtkWidget *parent);
string get_str(string title, string text, string def = "");

}
